package com.xyw.common.taobaokecommon.dto;


import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.xyw.common.taobaokecommon.vo.TklConvertVO;
import lombok.Data;

import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/8/5
 * Time: 下午3:28
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
@Data
public class TklConvertDTO extends BaseTaobaoRequest<TklConvertVO> {

    /**
     * ￥2k12308DjviP￥	需要解析的淘口令
     */
    private String passwordContent;

    /**
     * 广告位ID
     */
    private Long adzoneId;

    /**
     * 表示商品转通用计划链接，其他值或不传表示优先转营销
     */
    private String dx;

    @Override
    public String getApiMethodName() {
        return "taobao.tbk.tpwd.convert";
    }


    @Override
    public Map<java.lang.String, java.lang.String> getTextParams() {
        TaobaoHashMap txtParams = new TaobaoHashMap();
        txtParams.put("password_content", this.passwordContent);
        txtParams.put("adzone_id", this.adzoneId);
        txtParams.put("dx", this.dx);
        if (this.udfParams != null) {
            txtParams.putAll(this.udfParams);
        }

        return txtParams;
    }

    @Override
    public Class<TklConvertVO> getResponseClass() {
        return TklConvertVO.class;
    }

    @Override
    public void check() throws ApiRuleException {
        RequestCheckUtils.checkNotEmpty(this.passwordContent, "passwordContent");
        RequestCheckUtils.checkNotEmpty(this.adzoneId, "adzoneId");
    }


}
